<?php
/** $Id: default_form.php 11917 2009-05-29 19:37:05Z ian $ */
defined( '_JEXEC' ) or die( 'Restricted access' );
?>

<div class="p10t">
  <div class="tt3">
    <p class="text_tt1">Kontakt os</p>
  </div>
  <div class="box_pro p10t">
    <div class="p27l p15b p30t box_mail" style="min-height:515px;">
      <h5 class="p10b">KUNDENS INFORMATION</h5>
      Vær venlig at skrive dit spørgsmål eller kommentar på nedenstående form.<br />
      <br />
      <form action="<?php echo JRoute::_('index.php'); ?>" class="form-validate" method="post" name="contactForm" id="contactForm">
        <label>Kontakt person:</label>
        <input class="txt_mail w322" name="person" id="person" type="text" />
        <br class="cb" />
        <label>Email:</label>
        <input class="txt_mail w322" name="email" id="email" type="text" />
        <br class="cb" />
        <label>Firma/navn:</label>
        <input class="txt_mail w322" name="name" id="name" type="text" />
        <br class="cb" />
        <label>Emne:</label>
        <input class="txt_mail w322" name="subject" id="subject" type="text" />
        <br class="cb" />
        <label>Din besked:</label>
        <textarea class=" w322" name="message" id="message" cols="" rows=""></textarea>
        <br class="cb" />
        <label>&nbsp;</label>
        <a href="javascript:void(0);" onclick="click_send();"><img src="templates/xescort/images/bt_send.png" /></a> <a href="javascript:void(0);" onclick="reset_form();"><img src="templates/xescort/images/bt_nulstil.png" /></a>
        <input type="submit" name="send" id="send" value="Send" style="display: none;" />
        <input type="hidden" name="option" value="com_contact" />
        <input type="hidden" name="view" value="contact" />
        <input type="hidden" name="id" value="<?php echo $this->contact->id; ?>" />
        <input type="hidden" name="task" value="submit" />
        <input type="hidden" name="category_id" value="<?php echo JRequest::getVar('category_id', 0, 'get'); ?>" />
        <input type="hidden" name="Itemid" value="<?php echo JRequest::getVar('Itemid', 0, 'get'); ?>" />
      </form>
    </div>
  </div>
  {module Ads} </div>
<div class="center_bt"></div>
<script language="javascript">
jQuery(document).ready(function($) {	
	
	jQuery("#contactForm").validate({
		errorPlacement: function(error, element) {			
		},
		invalidHandler: function(form, validator) {
		  var errors = validator.numberOfInvalids();
		  if (errors) {
			jQuery('#alert').html(validator['errorList'][0]['message']);
			jQuery('#backoverlay').show();
			jQuery('#show_popup').show();
			jQuery('#f_focus').html(validator['errorList'][0]['element'].name);
			validator['errorList'][0]['element'].focus();
		  } else {
		  }
		},
		rules: {
			person : "required",
			email: {
				required: true,
				email: true
			},
			name : "required",
			subject : "required",
			message : "required"
		},
		messages: {
			person: "Kontaktperson skal udfyldes!",
			email: "Email skal udfyldes!",
			name: "Firma/navn skal udfyldes!",
			subject: "Emne skal udfyldes!",
			message: "Din besked skal udfyldes!"			
		}
	
	});
	
	close_popup=function(){		
		var fel=jQuery('#f_focus').html();
		jQuery('#backoverlay').hide();
		jQuery('#show_popup').hide();
		jQuery('#' + fel ).focus();
  };
  reset_form=function(){
		jQuery('#contactForm')[0].reset()
  };
  click_send=function(){
		document.getElementById('send').click();
  }
});
</script>
